﻿@typeparam TValue
@inherits SelectInputBase<TValue>

<div class=@FieldClass>
@if (!string.IsNullOrEmpty(UseLabel))
{
    <label for=@Id class=@ClassNames(SelectInput.LabelClasses, LabelClass)>@UseLabel</label>
}
    <select id=@Id name=@Id class=@ClassNames(SelectInput.InputBaseClasses, 
            CssClass(SelectInput.InputValidClasses, SelectInput.InputInvalidClasses))
            @bind="CurrentValue" @attributes="IncludeAttributes">
            @ChildContent
    @foreach (var kvp in KvpValues())
    {
        <option @key=@kvp.Key value=@kvp.Key>@kvp.Value</option>
    }
    </select>
    @if (HasErrorField)
    {
        <p class="@SelectInput.ErrorClasses" id=@($"{Id}-error")>@ErrorFieldMessage</p>
    }
</div>
